#PHP 7
Explore tagged Tumblr posts
ekip · 9 years ago
Text
Tumblr’da PHP 7
Tumblr olarak, sitemizin performansını iyileştirmek için sürekli yeni yollar arayışındayız. Yoğunlukla kullanılan kodyollarına kaşe eklemek, yeni CDN yapılandırmalarını denemek ya da temel software’I yükseltmek gibi şeyler, bu yolların birkaçı mesela.
Yakın bir zamanda, ekipler arası çalışmalar yaparak web sunucumuzu PHP 5’ten PHP 7’e yükselttik. Bu iyileştirme projesi oldukça eğlenceli oldu ve bayağı hoş sonuçlar elde ettik. Bunları sizinle paylaşmak istedik.
Zaman Çizelgesi
Hepsi 2015 sonbaharında bir hack günü projesi olarak başladı. @oli ve @tray Tumblr’ı PHP 7 aday sürümlerinden birinde çalıştırdılar. Bu noktada çok sayıda PHP eklentisi, sürüm 7’de desteklenmiyordu ama elimizde resmi olmayan ve oldukça deneysel yöntemlerle destek veren birkaç kaynak vardı. Sonuç olarak, her türlü karmaşaya rağmen Tumblr’ı sürüm 7’de çalıştırılabildi. Geçtiğimiz bahar, durum biraz daha dengeye oturunca sistemi yükseltmeyi daha yakından incelemeye başladık. Yaptığımız ilk şeylerden biri, bu yeni sürümü - kurumu kolay ve  tutarlı olması için – güzelce paketlemek oldu. Aynı zamanda bizim yaptığımız eklentileri de bu sürüme ekledik ve herşey hazırlanmış oldu. Geliştiricinin sunucusunu yükeseltecek (ya da indirecek) küçük bir skript yazıldı. İlkbahar sonu ve yaz boyunca testler yapıldı. PHP paketleri tekrar tekrar çalıştırıldı, performansı ölçüldü ve değerlendirmeden geçirildi. Bu sistem de dengeye oturdukça ekibimizden daha fazla geliştirici bu sistemi PHP 7 yürütebilen cihazlarında günlük şekilde kullanmaya başladı. Ağustos sonuna geldiğimizde, test sonuçlarımıza olan güvenimizle, PHP 7’yi yayımladık ve produksiyon sunucularımızın küçük bir kesiminde kullanmaya başladık. İki hafta sonra ise, kullanıcı taleplerini karşılayan bütün sunucularımızı bu şekilde güncelledik!
Test
Bunun gibi sistem yükseltmeleri yaparken, kodların aynı şekilde işlevselliğine devam ettiğini kontrol etmek için birkaç farklı yaklaşımımız oldu. Phan. Bu projede kendisini, kod merkezimizde PHP 7 ile uyumlu olmayan kodları bulmak için kullandık. Bu kodları bulup, hataları düzeltmek bu şekilde kolaylaşmış oldu. Evvelden düzgün çalışan ancak işlevinde bozukluk çıkmış olan kodları bulmak için birim ve entegresyon testleri de uyguladık. Bir yandan da normal geliştirme projeleri de devam ettiğinden, yeni oluşturulmuş bütün kodların PHP 7’de çalışabilir olduğuna da emin olmak için CI görevlerini hem PHP 5 hem de PHP 7’de test ettik.
Sonuçlar
Bu çalışmanın sonuçları ne oldu peki? İki önemli sonuçtan bahsedebiliriz: Performans ve dil özelliklerindeki kayda değer iyileşimler.
Performans
İlk grup sunucumuzda PHP 7’yi etkinleştirdiğimizde, farklı parametreleri yakından takip edip herşeyin düzgün gidip gitmediğini inceledik. Performansta iyileşim bekliyorduk ancak pratikte gördüğümüz sonuçlar beklediğimizin üstündeydi. Gecikme neredeyse anında yarıya inmişti ve sunuculardaki CPU yükü en az %50 azalmıştı. Sayfalardan sorumlu sunucularımız sadece iki katı hızlı çalışmıyor yetinmiyor, bunu CPU kaynaklarının yalnızca yarısını kullanarak yapıyorlardı.
Tumblr media Tumblr media
Bu grafikler, API’ımızı çalıştıran sunucularımızdan birinden. Gördüğünüz gibi gecikme kendi yarısından aza düşerken, en yüksek yük ortalaması evvelki en düşük yük ortalamasından daha az hale geldi!
Dil özellikleri
PHP Tumblr geliştiricilerinin hayatını biraz daha kolaylaştıran yeni özellikleri de beraberinde getirdi. Örnek olarak;
• Skaler yazı ipuçları: PHP geçmişinde yazı güvenliği konusunda zayıf kaldığını birkaç defa gösterdi. PHP 7’de ise belli tiplere (string, bool, int, float gibi..) uyumlu değerler gösteren skaler yazı ipuçlaru içeriyor. • Dönüş tipi dayatmaları: PHP 7 ile, fonksiyonlar artık kullanılan dilin uyguladığı özel dönüş tipi dayatmalarına sahip olabiliyorlar. Bu durum ise, ortak koda olan ihtiyacı ve fonksiyonların dönüşlerini manuel olarak kontrol etme ihtiyacını azaltıyor. • Anonim sınıflar: Anonim fonksiyonlarda olduğu gibi, anonim sınıflar da belirli bir çalışma zamanında işleme konuluyor ve arabirimler, diğer sınıflara kadar yayılabilmek üzere, başka bir sınıfı da harekete geçirebiliyor. Bu durum, logging sınıfları gibi faydalı nesnelerde ve birim testlerinde oldukça işe yarıyor. • Yukarıda bahsedilen noktaların dışında, genel olarak birçok farklı güvenlik ve performans iyileştirmelerini de bu listeye ekleyebiliriz.
Özet
PHP 7 bayağı çılgın bir şey yani!
186 notes · View notes
nixcraft · 8 years ago
Link
27 notes · View notes
glowhost · 9 years ago
Text
PHP 7 Web Hosting
PHP 7 Offers Increased Performance at GlowHost
We are happy to announce that PHP 7 is now available on all (without exception) packages GlowHost offers, including shared, reseller, cloud, semi-dedicated, and dedicated servers!
This is great news because the GlowHost team has been looking forward to the release of the newest PHP version for quite some time. The key to PHP 7’s success here is performance! Zend Technologies claims that this new…
View On WordPress
5 notes · View notes
mycupofphp · 11 years ago
Link
So if you really wanted to revamp this ancient API you probably want to do away with $_POST/$_GET/$_REQUEST/$_FILES superglobals altogether and really think about this problem for a second.
PHP deals with HTTP directly in many ways. It reads, parses, and sometimes even generates HTTP headers/bodies in key areas. Like when session_start() is called, PHP looks for an HTTP cookie header and seeks out the session_name() cookie then matches it against the available session storage data to either populate or initialize the $_SESSION superglobal.
So why is the HTTP request METHOD important in distinguishing which super global variable we use?
It isn't!
Things php populates $_POST are merely form url encoded parts of the HTTP request body. $_GET is populated from the request header's path string after parsing the query parameters (if any). So realistically anyone requesting support for $_PUT actually doesn't understand how HTTP works or how PHP deals with HTTP requests and how these superglobals are being populated.
The real problem here is that PHP doesn't parse the request body and populate it in $_POST unless the body is properly url encoded according the HTTP spec. Instead, you have to deal with the php://input stream directly and parse it yourself.
The PUT HTTP verb is intended to act upon the destination URI directly as per the enclosed entity, according to rfc2616. Yet, people seem to understand RESTful less than they regurgitate the word.
The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource.
So let's forget about HTTP verbs for a second and deal with the HTTP request through some sane (non-backwards-compatible) interface.
First, make PhpRequest a new extensible interface, expose it to userland, and allow the user to override it's implementation with user-implemented classes. Second, stop making the request parsing and content buffer flushing decisions at the RINIT stage. Let's just buffer and delegate to the runtime!
Done. Problem solved. Everyone happy. No more confusing nonsense super globals. 
3 notes · View notes
Link
1 note · View note
regulardomainname · 10 years ago
Text
ICYMI: The Weekly Ledger
Why Women Veterans Are the Fastest-Growing Group of Entrepreneurs The number of companies owned by female veterans has nearly quadrupled in the past five years. AI Startup Grades the Excitement On Your Website A virtual AI that teaches software to view web and mobile design the way people do. The Future of Web Design Again? Interested in the trends just around the corner, we're not quite at, but are getting closer to. Websites With Beautiful Video Headers A showcase of some other sites around the web with beautiful video headers. Which Programming Language Is Perfect For Me? The perfect programming language that you need to learn right now, depending upon your needs and ideas. A Look at Google’s Art Projects We’d like to take a moment to appreciate the tech overachiever’s investment in the arts. 10 Jobs That Strike The Best Work-Life Balance Today’s job seeker wants to have her cake and eat it, too. There’s nothing wrong with that. Is the Future of Tech Making UI Irrelevant? These technologies are not “a look into the future” type of product. They currently exist! PHP 7: What’s New & How Will It Affect a WordPress Site? Despite the fact that WordPress core development team is continuously working on making the CMS ready for PHP7, the latest version of PHP can break your site. Read More at ICYMI: The Weekly Ledger http://dlvr.it/ClcdnK www.regulardomainname.com
1 note · View note
anushasaive · 5 years ago
Link
0 notes
techidology · 5 years ago
Link
0 notes
nixcraft · 8 years ago
Link
PHP 7 is a dynamic scripting langauge for delivering applications. You can get 2x faster performance and 50% better memory consumption than PHP 5.6, allowing you to serve more concurrent users without adding any hardware. However, PHP 7 not included with Debian 8.x stable version. In this tutorial, you will learn about installing PHP 7 on Debian 8.6 server. 
7 notes · View notes
sherifr · 11 years ago
Link
1 note · View note
aegissofttech · 5 years ago
Link
Speaking of Magento, this is one of the better and preferred eCommerce platforms written in the platform PHP. In this article, we will tell you about the impact of PHP 7 on the development of the Magento site.
0 notes
mycupofphp · 11 years ago
Link
In recent months I've been ultra busy working on our Z-Ray time-warping technology.  Now that it's out, I finally had a bit of free time to follow up and on what was clearly a very interesting topic for many in the PHP community - what kind of impact does PHPNG - a massive refactoring effort of the Zend Engine - have on PHP's performance.
1 note · View note
virendrachandak · 5 years ago
Text
PHP 7.4 - Null Coalesce Assignment Operator
PHP 7.4 – Null Coalesce Assignment Operator
PHP 7.4 added a new Null Coalesce Assignment Operator (??=) which is an enhancement of Null Coalesce Operator (??)introduced in PHP 7. The Null Coalesce Assignment Operator (??=) assigns the value of the right-hand parameter if the left-hand parameter is null. If the left-hand parameter is not null then its value is not changed. The Null Coalesce Assignment Operator is sometimes also called as…
View On WordPress
0 notes
lilaayu · 6 years ago
Link
Learn PHP 7, MySQL, Object-Oriented Programming, PHP Forms, Build a secure login script, learn object-oriented programming, submit forms to MySQL and more.
0 notes
illuminarch · 6 years ago
Text
Hackers estão usando um bug no PHP 7 para invadir servidores web remotamente
Hackers estão usando um bug no PHP 7 para invadir servidores web remotamente
A linguagem de programação PHPsustenta grande parte da Internet. Ele forma a base de sistemas populares de gerenciamento de conteúdo como WordPress e Drupal, além de aplicativos da Web mais sofisticados, como o Facebook. Portanto, é uma excelente notícia sempre que os pesquisadores identificam uma vulnerabilidade de segurança dentro dela. Neste artigo, veja como hackers estão explorando um bug no…
View On WordPress
0 notes
techdynamix · 6 years ago
Text
New PHP Flaw Could Let Attackers Hack Sites Running On Nginx Servers
New PHP Flaw Could Let Attackers Hack Sites Running On Nginx Servers
Tumblr media
If you’re running any PHP based website on NGINX server and have PHP-FPM feature enabled for better performance, then beware of a newly disclosed vulnerability that could allow unauthorized attackers to hack your website server remotely.
The vulnerability, tracked as CVE-2019-11043, affects websites with certain configurations of PHP-FPM that is reportedly not uncommon in the wild and could be…
View On WordPress
0 notes